﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Undertaking_Form.aspx.cs"
    EnableSessionState="True" Inherits="Trig_AMJ_HR_Forms.Layouts.Trig_AMJ_HR_Forms.Undertaking_Form"
    DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <link rel="Stylesheet" type="text/css" href="/_layouts/1033/STYLES/Themable/FORMS.CSS" />
     <link rel="Stylesheet" type="text/css" href="/Style Library/Al Majed/CSS/Trig_HR.css"  />
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <asp:Panel runat="server" ID="pnlUTNew" CssClass="pnlAMFform">
        <table cellpadding="0" cellspacing="0" class="tbl-main" width="1000px">
            <tr>
                <td colspan="4" class="formtitle">
                    Undertaking Form
                </td>
            </tr>
            <tr>
			    <td>Reference No :</td>
                <td >
                        <asp:Label ID="lblReferenceNo" runat="server" Text="Reference number will be generated upon save"
                        Font-Bold="True" Font-Size="XX-Small" CssClass="ms-long ms-spellcheck-true" ForeColor="Red"></asp:Label>
                </td>
				<td>Date if filling :</td>
                <td >
                    <SharePoint:DateTimeControl runat="server" ID="dtDate" IsRequiredField="true" DateOnly="true" LocaleId="2057" Enabled="false" />
                </td>
            </tr>

            <tr>
			<td> Leave Reference No :</td>
                <td >
                   
                    <asp:Label runat="server" ID="lblLeaveRefNo"></asp:Label>
                </td>
				<td>Leave Status : </td>
                <td >
                    <asp:Label runat="server" ID="Label3" Text="Approved"></asp:Label>
                </td>
            </tr>


            <asp:Panel runat="server" ID="pnlAttAdd" Visible="false">

            <tr>
			<td> Upload Attachment</td>
                <td >
                   
                    <asp:FileUpload ID="inputFile" runat="server" CssClass="ms-fileinput" Width="250px" />
                </td>
                <td>
                    <asp:Button runat="server" ID="btnUpload" Text="Add" CssClass="ms-ButtonHeightWidth" />
                </td>
            </tr>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <tr>
                        <td class="tdCell" colspan="2">
                            Attchment(s)
                        </td>
                    </tr>
                    <tr>
                        <td class="tdCell" colspan="2">
                            <asp:Label runat="server" ID="lblRecords" Text="No Records found" Visible="true"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:GridView runat="server" ID="dgUpload" AutoGenerateColumns="false" OnRowDeleting="dgUpload_RowDeleting"
                                CssClass="Grid-default" AlternatingRowStyle-CssClass="alt-tr">
                                <Columns>
                                    <asp:HyperLinkField DataTextField="FileName" HeaderText="FileName" DataNavigateUrlFormatString="FilePath" />
                                    <asp:BoundField HeaderText="FileSize" DataField="FileSize" />
                                    <asp:BoundField HeaderText="" DataField="KB" />
                                    <asp:CommandField HeaderText="Delete" ButtonType="Image" InsertImageUrl="~/_layouts/1033/IMAGES/delete.png"
                                        ShowDeleteButton="true" />
                                </Columns>
                            </asp:GridView>
                        </td>
                    </tr>
                </ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="btnUpload" />
                </Triggers>
            </asp:UpdatePanel>

            </asp:Panel>

            <tr runat="server" id="trAtt" visible="false">
                <td colspan="2">
                    <asp:GridView runat="server" ID="gvAtts" OnRowDataBound="gvAtts_RowDataBound" AutoGenerateColumns="false"
                        CssClass="Grid-default" AlternatingRowStyle-CssClass="alt-tr">
                        <Columns>
                            <asp:TemplateField HeaderText="Attachment(s)" ItemStyle-CssClass="td-left" HeaderStyle-CssClass="td-center">
                                <ItemTemplate>
                                    <asp:HyperLink ID="lnkViewAttachments" Target="_blank" runat="server" Text='<%# Eval("FileLeafRef") %>'></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td class="lblErrorMsg" colspan="2" style="text-align: center;padding:5px;" >
                    <asp:Label Text="" ID="lblMessage" runat="server" Font-Bold="True" Font-Size="XX-Small"
                        ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <tr style="padding:5px">
                <td align="center" colspan="4" style="padding:17px" class="tblButtons">
                    <asp:Button runat="server" ID="btnSubmit" Text="Upload" CssClass="btn-Submit" 
                        Visible="true" />
                    <input id="butonclose" class="btn-Cancel" type="button" onclick="SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, 'Cancel clicked'); return false;"
                        value="Close" accesskey="C" />
                </td>
            </tr>
        </table>
    </asp:Panel>
     <asp:Panel ID="pnlAlert" runat="server">
    </asp:Panel>

    <script language="javascript" type="text/javascript">
        document.getElementById('<%= lblMessage.ClientID  %>').innerHTML = "";
        document.getElementById('<%= lblMessage.ClientID  %>').style.display = "none";

        function closeWindow() {
            window.frameElement.commitPopup();
        }
    </script>

</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    Undertaking Form
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    Undertaking Form
</asp:Content>
